package com.opengate.base.authtoken;

import com.alibaba.fastjson.JSON;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Getter;
import lombok.Setter;
import lombok.experimental.Accessors;

import java.util.List;

/**
 * @author 曳戈泰尔
 * @version 1.0
 * @description 用户token
 * @date 2023/4/26 5:46 PM
 */
@Setter
@Getter
@Accessors(chain = true)
@Schema(description = "用户token")
public class UserToken {

    /** UserDto 列表 */
    @Schema(description = "用户token列表")
    private List<UserDto> userDtos;

    /** UserDto */
    @Setter
    @Getter
    @Accessors(chain = true)
    public static class UserDto {

        @Schema(description = "登录时间")
        private long loginTime;

        @Schema(description = "过期时间")
        private long expireTime;

        @Schema(description = "token")
        private String token;
    }

    /**
     * toString重写
     *
     * @return JSON字符串
     */
    @Override
    public String toString() {
        return JSON.toJSONString(this);
    }
}
